'use client';

import "./tailwind.css"
import {themeStore} from '@/app/store/theme/index.js'
import {clsx} from 'clsx'
/**
 * 动态切换主题色两种方式
 * 1. tailwind.css 中定义darkMode: ['[data-mode="dark"]'],，通过 data-mode='dark' 来切换主题色
 * 使用<html lang="en" data-mode='dark'>
 * 2. tailwind.css 中定义darkMode: ['selector','[data-mode="dark"]'],，通过 className={'dark'}来切换主题色
 */
export default function RootLayout({ children }) {
  const {dark} = themeStore(state => state);
  return (
    /*<html lang="en" className={'dark'}>*/
    <html lang="en" data-mode={clsx({"dark":dark})}>
      <body>
        {children}
      </body>
    </html>
  );
}
